﻿
@{
    Layout = "~/Areas/Admin/Views/Shared/_form_layout.cshtml";
}
<div class="layui-tab layui-tab-brief" lay-filter="user">
    <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding:0px;">
        @using (Html.BeginForm(FormMethod.Post, htmlAttributes: new { @class = "layui-form" }))
        {
            <a href="/Content/temp/Show.zip" target="_blank" style="display:block;text-align:center;margin:20px 0px">下载模版,<span style="color:red;">只能上传.cshtml后缀的文件</span></a>
            <div style="text-align:center;"><button type="button" class="layui-btn" id="UploadFile"><i class="layui-icon">&#xe681;</i>上传文件</button></div>
            
        }
    </div>
</div>
<script type="text/javascript">
    layui.use(['upload','layer'], function () {
        var upload = layui.upload;
        var layer = layui.layer;
        upload.render({
            elem: '#UploadFile'
            , url: '/Admin/CustomForm/UploadTemplateFile?id=@ViewBag.ID'
            , accept: 'file' //普通文件
            , exts: 'cshtml' //只允许上传压缩文件
            , done: function (res) {
                if (res== "success") {
                    parent.FinshOther("上传成功!");
                }
                else {
                    layer.msg(res);
                }
            }
        });
    });

</script>

